package ch.nostromo.tiffanys.tests.libraries;

import ch.nostromo.lib.controller.NosSettingsException;
import ch.nostromo.tiffanys.engines.EngineSettings;
import ch.nostromo.tiffanys.tests.TestBase;

public class TestEngineSettings extends TestBase {

  public void testEngineSettings() throws NosSettingsException  {
    
    EngineSettings emptySettings = new EngineSettings();

    // Write Empty Settings
    new EngineSettings("test-settings.xml", true);
    
    EngineSettings loadedSettingsA = new EngineSettings("test-settings.xml");
    EngineSettings loadedSettingsB = new EngineSettings("test-settings.xml");
    
    
    assertTrue(emptySettings.GAME_MODE == loadedSettingsA.GAME_MODE);

    assertTrue(loadedSettingsB.FIXED_DEPTH == loadedSettingsA.FIXED_DEPTH);
    
    loadedSettingsB.FIXED_TIME_PER_MOVE  = 123456;
    
    assertFalse(loadedSettingsB.FIXED_TIME_PER_MOVE == loadedSettingsA.FIXED_TIME_PER_MOVE);
    
  }
  
}
